import request from '@/utils/request'

// 查询作业管理中心列表
export function listJob(query) {
    return request({
        url: '/resource/job/list',
        method: 'get',
        params: query
    })
}

// 查询作业管理中心详细
export function getJob(id) {
    return request({
        url: '/resource/job/' + id,
        method: 'get'
    })
}

// 新增作业管理中心
export function addJob(data) {
    return request({
        url: '/resource/job',
        method: 'post',
        data: data
    })
}

// 修改作业管理中心
export function updateJob(data) {
    return request({
        url: '/resource/job',
        method: 'put',
        data: data
    })
}

// 删除作业管理中心
export function delJob(id) {
    return request({
        url: '/resource/job/' + id,
        method: 'delete'
    })
}

export function deleteHdfsTmp(params) {
    return request({
        url: '/resource/job/deleteHdfsTmp',
        method: 'post',
        data:params
    })
}

export function getFlinkConfByJobId(jobId) {
    return request({
        url: '/resource/job/getFlinkConfByJobId/'+jobId,
        method: 'get'
    })
}


export function deployejob(jobId) {
    return request({
        url: '/resource/job/deployejob/'+jobId,
        method: 'put'
    })
}

export function startJob(param) {
    return request({
        url: '/resource/job/startJob',
        method: 'post',
        data:param
    })
}


export function stopJob(param) {
    return request({
        url: '/resource/job/stopJob',
        method: 'post',
        data:param
    })
}


export function verifySql(param) {
    return request({
        url: '/resource/job/verifySql',
        method: 'post',
        data:param
    })
}

export function getErrorLogByJobId(jobId) {
    return request({
        url: '/resource/job/getErrorLogByJobId/'+jobId,
        method: 'get'
    })
}




